# n largest prime factor:
# * find factor f from 2 -> sqrt(n)
# * if a factor is found
#   * reduce n to n / f (repeat if n is still f multiple)
#   * if n become 1, then f is the biggest factor
# * if no factor is found, n is the biggest factor

def Solve():
    n = 600851475143
    f = 2

    while f*f <= n:
        if n % f == 0:
            n //= f
            continue
        f += 1

    return max(f, n)

